package com.tencent.sr.iris.activity.common.exception;

import com.tencent.sr.rmall.common.exception.code.ErrorCode;

/**
 * 公共的异常枚举
 *
 * @author xiaodongguo
 * @date 2021/12/15
 */
public enum BizCommErrorCode implements ErrorCode {
    OUT_LET_BIZ_ERROR("操作失败"),
    OUT_LET_KAFKA_TOPIC_ERROR("Kafka消息发送失败"),
    PARAM_ERROR("参数异常"),
    DELAY_JOB_SUBMIT_ERROR("延时组件提交失败"),
    ES_QUERY_ERROR("es查询系统异常"),
    NOT_OUTER_SIGN("不是外部帐号体系"),
    TYPE_TRANS_ERROR("类型转换错误"),
    HTTP_FAIL("http请求失败"),
    RPC_ERROR("远程调用失败"),
    EXCEL_DATA_ERROR("EXCEL_DATA_ERROR", "请检查Excel数据，第【%s】行，第【%s】列"),
    CHECK_GROUP_IDENTITY("当前用户不是团长"),
    CHECK_ADVISOR_IDENTITY("当前用户不是导师"),
    DTO_TRALATE_ERROR("类型转换错误"),
    OUTLET_KAFKA_TOPIC_ERROR("Kafka消息发送失败"),
    UID_EMPTY("uid不能为空"),
    USER_LEVEL_TYPE_ERROR("用户等级错误"),
    USER_CROSS_LEVEL_UP_ERROR("用户不能跨级"),
    USER_NOT_EXIST("用户不存在"),
    TUTOR_NOT_EXIST("导师不存在"),
    USER_IS_DELETED("用户已注销"),
    GROUP_TASK_NOT_EXIST("团长任务不存在"),
    REDIS_EXECUTE_ERROR("redis操作失败"),
    ;
    private final String description;

    BizCommErrorCode(String description) {
        this.description = description;
    }

    BizCommErrorCode(String code, String description) {
        this.description = description;
    }

    @Override
    public String getCode() {
        return this.name();
    }

    @Override
    public String getDescription() {
        return this.description;
    }
}
